package com.antu.first.enums;

/**
 * Created by Administrator on 2018/3/8.
 */
public enum SwiperStateEnum {
    UPLOAD_SUCCESS(0,"上传成功"),
    EMPTY_LIST(-101,"轮播图信息不完整，请完善后提交！"),
    CREATE_FAILED(-102,"创建轮播图列表失败！"),
    NULL_IMGADDR(-103,"图片地址为空"),
    NULL_POINT(-104,"Swiper基础信息为空");

    private int state;

    private String stateInfo;

    SwiperStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public static SwiperStateEnum valueOf(int key){
        for(SwiperStateEnum stateEnum : values()){
            if(stateEnum.getState() == key){
                return stateEnum;
            }
        }
        return null;
    }
}
